home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / Universal Interfaces / PPCCIncludes / stdiostream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-13  |  681 b   |  37 lines  |  [TEXT/MPS ]

  1. #ifndef STDIOSTREAM_H
  2. #define STDIOSTREAM_H 1
  3.  
  4. #include <iostream.h>
  5. #include <stdio.h>
  6.  
  7. class stdiobuf : public streambuf {
  8.     /*** stdiobuf is obsolete, should be avoided ***/
  9. public: // Virtuals
  10.     virtual int    overflow(int=EOF);
  11.     virtual int    underflow();
  12.     virtual int    sync() ;
  13.     virtual streampos
  14.             seekoff(streamoff,ios::seek_dir,int) ;
  15.     virtual int    pbackfail(int c);
  16. public:
  17.             stdiobuf(FILE* f) ;
  18.     FILE*        stdiofile() { return fp ; }
  19.     virtual        ~stdiobuf() ;
  20. private:
  21.     FILE*        fp ;            
  22.     int        last_op ;
  23.     char        buf[2];
  24. };
  25.  
  26. class stdiostream : public ios {
  27. public:
  28.             stdiostream(FILE*) ;
  29.             ~stdiostream() ;
  30.     stdiobuf*    rdbuf() ;
  31. private:    
  32.     stdiobuf    buf ;
  33.  
  34. };
  35.  
  36. #endif /*STDIOSTREAM_H*/
  37.